import React, { PureComponent } from 'react'
import PropTypes from 'prop-types';
import {testStyle} from './../../../../styles'
import TestInfo from './testInfo'

import {
    Text,
    View,
    TouchableOpacity,
} from 'react-native';

export default class TestItem extends PureComponent {



    render() {
        const {detail} = this.props;
        return (
            <View style={testStyle.inline}>
                <TouchableOpacity >
                <Text style={testStyle.instructions}>{detail.name}-{detail.pwd}-{detail.phone}</Text>
                </TouchableOpacity>
                <TouchableOpacity onPress={() => {this.goGet(detail.id)}}>
                <Text>go</Text>
                </TouchableOpacity>
            </View>
        )
    }

    goGet(id){
        this.props.navigation.navigate('TestInfo',{
            userId:id
        });
        // this.props.navigation.push({
        //     name: 'testInfo',
        //     component: TestInfo,
        //     //sceneConfig: Navigator.SceneConfigs.PushFromRight,
        //     params: {
        //         userId:id
        //     }
        // })
    }
   
}

TestItem.propTypes = {
    detail:PropTypes.shape({
            id:PropTypes.number,
            name: PropTypes.string,
            pwd:PropTypes.string,
            phone: PropTypes.string
        })
};